package Test1223;

public class Test11 {
    public static void main(String[] args) {
        // ABCDE=4*EDCBA;其中，A、B、C、D、E都是1-9中的数字。问这5个数字都是多少。
        for (int A = 1; A <= 9; A++) {
            for (int B = 1; B <= 9; B++) {
                if (B == A) continue;
                for (int C = 1; C <= 9; C++) {
                    if (C == A || C == B) continue;
                    for (int D = 1; D <= 9; D++) {
                        if (D == A || D == B || D == C) continue;
                        for (int E = 1; E <= 9; E++) {
                            if (E == A || E == B || E == C || E == D) continue;
                            int ABCDE = A * 10000 + B * 1000 + C * 100 + D * 10 + E;
                            int EDCBA = E * 10000 + D * 1000 + C * 100 + B * 10 + A;
                            if (ABCDE == 4 * EDCBA) {
                                System.out.println("A=" + A + ", B=" + B + ", C=" + C + ", D=" + D + ", E=" + E);
                            }
                        }
                    }
                }
            }
        }
    }
}